Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Structure Refactor #43

Closed
wants to merge 133 commits into from
Closed

Conversation

pulsipher
Copy link
Collaborator

@pulsipher pulsipher commented May 13, 2022

This pull request will take some time and seeks to completely refactor DisjunctiveProgramming.jl to better extend JuMP in a more modular and performant way.

TODO

  • Finish basic mechanics for creating/storing disjunction constraints
  • Add types and methods to create/store logical propositions
  • Decide whether we should create our own logical variable type
  • Add printing (save for a future PR)
  • Implement the reformulation techniques (Big-M, Hull, Indicator Constraints): affine, quadratic, and nonlinear
  • Implement reformulations for logical propositions
  • Implement reformulations for logical selectors (exactly, at least, at most)
  • Add macro(s) for disjunction addition
  • Add tests
  • Add documentation via Documenter.jl (save for a future PR)
  • Support nested disjunctions
  • Update the README.md and move tutorial/guide to docs.

@hdavid16 hdavid16 marked this pull request as ready for review August 30, 2022 16:26
@hdavid16 hdavid16 marked this pull request as draft August 30, 2022 16:26
Copy link
Collaborator Author

@pulsipher pulsipher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. My main recommendations pertain to not modifying the object dictionary, being more careful about constraint types, adding fallbacks, and adapting the code to leverage JuMP's new nonlinear interface.

src/bigm.jl Outdated Show resolved Hide resolved
src/bigm.jl Outdated Show resolved Hide resolved
src/datatypes.jl Outdated Show resolved Hide resolved
src/datatypes.jl Outdated Show resolved Hide resolved
src/datatypes.jl Outdated Show resolved Hide resolved
src/hull.jl Outdated Show resolved Hide resolved
src/hull.jl Outdated Show resolved Hide resolved
src/hull.jl Outdated Show resolved Hide resolved
src/propositions.jl Outdated Show resolved Hide resolved
src/reformulate.jl Show resolved Hide resolved
@pulsipher
Copy link
Collaborator Author

Before we merge this, I think it would make sense to unify some of our logical operators with JuMP. Specifically, I think we should support:

  • && for logical and
  • || for logical or
  • == for logical equivalence
    And adjust the underlying symbols in the NonlinearExprs accordingly. Our current operators would just be another way to define things.

We might also consider supporting this addition to JuMP: jump-dev/JuMP.jl#3530. This would allow users to avoid wrapping the expression in parentheses and explicitly give the set.

Let me know what you think.

@pulsipher
Copy link
Collaborator Author

I think this is ready to be merged, but it might be worth waiting to see what develops with jump-dev/JuMP.jl#3530 so can we can adjust the logical constraint structure accordingly. Alternatively, we can merge this and then address any adjustments in a future PR before releasing a new version of DisjunctiveProgramming.

@hdavid16
Copy link
Owner

Let's merge and add support for := in a later release. Thanks!

@hdavid16 hdavid16 self-assigned this Oct 11, 2023
@hdavid16 hdavid16 self-requested a review October 11, 2023 16:21
@hdavid16
Copy link
Owner

Copied over to #68

@hdavid16 hdavid16 closed this Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants